#include "modifiypassworddialog.h"
#include "ui_modifiypassworddialog.h"
#include <QMessageBox>

ModifiyPasswordDialog::ModifiyPasswordDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ModifiyPasswordDialog)
{
    ui->setupUi(this);
}

ModifiyPasswordDialog::~ModifiyPasswordDialog()
{
    delete ui;
}

void ModifiyPasswordDialog::on_pushButton_clicked()
{
    QString username = ui->lineEdit->text().trimmed();
    QString password = ui->lineEdit_2->text().trimmed();
    QString new_password = ui->lineEdit_3->text().trimmed();
    if(username == "" || password == "" || new_password == "")
    {
        QMessageBox::information(this, tr("Error"), tr("invalid username or password"));
        return;
    }

    this->username = username;
    this->password = password;
    this->new_password = new_password;
    close();
}

void ModifiyPasswordDialog::on_pushButton_2_clicked()
{
    close();
    return;
}
